Skip to main content
Version: 5.0

TimePunch Project Service

This service contains methods in order to work with the projects of TimePunch.

CreateProject

This method creates a new project and returns it. The project is saved directly in the database when it is created and filled with the default values.

ProjectDto CreateProject(  
out TpFault fault,
TpAuthentication authentication,
string projectId,
string projectDescription,
string projectCode,
Guid? copyFromProject);
Needed Permissionprojects@manage
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
projectIdUnique identifier of the project
projectDescriptionShort description of the project
projectCodeUnique identifier that can be used by a barcode reader
Guid?Id of the project that shall be used as a template, or NULL.
Return valueReturns the created project

DeleteProject

This method deletes the given project physically in the database. But this can only be done, if the project is not referenced by any time-entries. If the project is referenced it’s recommended to do a soft-delete. That means to set the delete flag in the project entity.

void DeleteProject(  
out TpFault fault,
TpAuthentication authentication,
Guid projectId);
Needed Permissionprojects@manage
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
projectIdId of the project that shall be deleted

ExportProjectUserRelations

This method exports the employee-specific settings for one or more projects.

List<ProjectUserRelationDto> ExportProjectUserRelations(  
out TpFault fault,
TpAuthentication authentication,
ProjectSearchDto projectSearch);
Needed Permissionprojects@export
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
searchCriteriaCriteria that are used for searching the projects.
Return valueCollection of project related user data

GetProjectUsers

This method returns a list of TimePunch profiles that are able to book on certain projects

List<ProjectUserDto> GetProjectUsers(  
out TpFault fault,
TpAuthentication authentication,
Guid[] projectIds);
Needed Permissionprojects@report
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
projectIdsCollection of project ids to load the project relevant times
Return valueList of project / user combinations that are allowed to book the relevant project ids. It also contains the scheduled work and the pool type (Shared / Private)

GetTotalProjectTimes

This method is used to retrieve the current project times for the given projects and employees.

List<ProjectTimeDto> GetTotalProjectTimes(  
out TpFault fault,
TpAuthentication authentication,
Guid[] projectIds,
Guid[] userIds);
Needed PermissionUserIds == null ? projects@access : projects@report
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
projectIdsCollection of project ids to load the project relevant times
userIdsUser ids of all users for which the project data shall be loaded, or null to load the data for the current user.

ImportProjects

This method imports a list of projects. In contrast to the Save method, it is not the project IDs that are used for identification, but the project name.

void ImportProjects(  
out TpFault fault,
TpAuthentication authentication,
List<ProjectDto> projects);
Needed Permissionprojects@import
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
projectsCollection of projects to import

ImportProjectTasks

This method imports a list of project-specific activities. The activities are identified by the description text and not by the task ID.

void ImportProjectTasks(  
out TpFault fault,
TpAuthentication authentication,
List<ProjectTaskDto> projectTasks);
Needed Permissionprojects@import
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
projectTasksCollection of project dependend tasks to import

ImportProjectUserRelations

This method imports the employee assignments to a project. In contrast to the SaveProjectUserRelations method, the employees are not assigned to the logon name via the technical ID, but via the logon name.

void ImportProjectUserRelations(  
out TpFault fault,
TpAuthentication authentication,
List<ProjectUserRelationDto> userRelations);
Needed Permissionprojects@import
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
userRelationsCollection of project user relations tasks to import

LoadProject

This method loads the project with the given project id.

ProjectDto LoadProject(  
out TpFault fault,
TpAuthentication authentication,
Guid projectId);
Needed Permissionprojects@access
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
projectIdId of the project to load
Return valueThe loaded project data

LoadProjectUserRelations

This method loads the employee-specific settings of a project for all authorized employees.

List<ProjectUserRelationDto> LoadProjectUserRelations(  
out TpFault fault,
TpAuthentication authentication,
Guid projectId);
Needed Permissionprojects@access
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
projectIdId of the project to load
Return valueCollection of user specific project data

MarkProjectsAsDone

This method sets the delete-flag in the project and marks the project therefore as finished. That means it’s not allowed to book new time-entries to the project. But existing time-entries stay as they are.

void MarkProjectsAsDone(  
out TpFault fault,
TpAuthentication authentication,
Guid[] projectIds);
Needed Permissionprojects@manage
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
projectIdsCollection of project ids to set the soft delete flag

SaveProject

This method stores the project in the database.

ProjectDto SaveProject(  
out TpFault fault,
TpAuthentication authentication,
ProjectDto project);
Needed Permissionprojects@access
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
projectProject data that shall be stored
Return valueThe stored project data will be returned

SaveProjectUserRelations

This method updates the employee assignment in the projects.

void SaveProjectUserRelations(  
out TpFault fault,
TpAuthentication authentication,
List<ProjectUserRelationSaveDto> userRelations);
Needed Permissionprojects@manage
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
userRelationsList of user and project related data.

SearchAuthorizedProjects

This method searches for projects in which the employee is authorized, using the specified search criteria. The found projects are returned. Authorized projects are all projects assigned to the employee.

List<ProjectDto> SearchAuthorizedProjects(  
out TpFault fault,
TpAuthentication authentication,
ProjectSearchDto searchCriteria);
Needed Permissionprojects@access
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
searchCriteriaCriteria that are used for searching the projects.
Return valueCollection of found projects

SearchReportingProjects

This method searches for projects where the employee is authorized to run reports. The projects found are returned. All projects are returned for which the employee himself, or one of the employees assigned to the groups, is authorized.

List<ProjectDto> SearchReportingProjects(  
out TpFault fault,
TpAuthentication authentication,
ProjectSearchDto searchCriteria);
Needed Permissionprojects@access
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
searchCriteriaCriteria that are used for searching the projects.
Return valueCollection of found projects

SearchProjects

This method searches all available projects with the given search criteria. The found projects will be returned.

List<ProjectDto> SearchProjects(  
out TpFault fault,
TpAuthentication authentication,
ProjectSearchDto searchCriteria);
Needed Permissionprojects@access
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
searchCriteriaCriteria that are used for searching the projects.
Return valueCollection of found projects

SetProjectLifeCycle

This method sets the current lifecycle of one or more projects. The lifecycle specifies how the project can be used in TimePunch.

public enum ProjectLifeCycle

{

/// Life cycle is undefined

Undefined,

/// The project can be changed, but not booked

Planning,

/// The project can be changed and booked

Active,

/// The project can not be changed, not booked, but reported

Done,

/// The project can not be changed, not booked and is not visible for reporting

Deleted,

}
void SetProjectLifeCycle(  
out TpFault fault,
TpAuthentication authentication,
Guid[] projectIds,
ProjectLifeCycle projectLifeCycle);
Needed Permissionprojects@manage
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
projectIdsCollection of project ids for that the life cycle shall be changed.
projectLifeCylceThe new life cycle to set